<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Supplier extends Model
{
    protected $fillable = [
        'name',
        'contact_name',
        'contact_phone',
        'contact_address',
        'description',
        'sort',
        'status'
    ];

    protected $casts = [
        'status' => 'boolean'
    ];

    // 关联商品
    public function products()
    {
        return $this->hasMany(Product::class);
    }
}
